<template>
	<view class="route-target-page">
		<text class="txt">从上个页面带过来的参数name: {{parentParam.name}}</text>
		<text class="txt">从上个页面带过来的参数age: {{parentParam.age}}</text>
		<button class="btn" @click="goBack">返回</button>
	</view>
</template>

<script setup>
	import { ref, reactive} from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	
	
	const parentParam = reactive({
		age: 0,
		name: 'test'
	})
	
	onLoad((options) => {
		if(options.name && options.age) {
			parentParam.name = options.name
			parentParam.age = options.age
		}
	})
	
	const goBack = ()=>{
		uni.navigateBack()
	}
</script>

<style lang="less" scoped>
	.route-target-page{
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		width: 100%;
		height: 100%;
		padding: 20px;
		align-items: center;
		justify-content: center;
		
		.txt,.btn {
			margin-top: 25px;
		}
	}
</style>
